home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / examples / lexyacc / Data.sml next >
Encoding:
Text File  |  1997-08-18  |  584 b   |  18 lines  |  [TEXT/R*ch]

  1. (* Data.sml  -- the abstract syntax datatype *)
  2.  
  3. datatype baseval = 
  4.     Int of int
  5.  
  6. datatype sourceexpr = 
  7.     AppS of sourceexpr * sourceexpr
  8.   | VarS of string
  9.   | LamS of string * sourceexpr
  10.   | LetS of (string * sourceexpr) list * sourceexpr
  11.   | LetrecS of (string * sourceexpr) list * sourceexpr
  12.   | ConS of int * sourceexpr list
  13.   | CaseS of sourceexpr * alt list
  14.   | CstS of baseval                             
  15.   | Op2S of (baseval * baseval -> baseval) * sourceexpr * sourceexpr
  16.   | IfS  of sourceexpr * sourceexpr * sourceexpr
  17. withtype alt = int * string list * sourceexpr
  18.